package spring.aop;

public class AopPointcut {

    private String id;

    private String expression;

    private String exp;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getExpression() {
        return expression;
    }

    public void setExpression(String expression) {
        this.expression = expression;
        convertRegularExpression();
    }

    public String getExp() {
        return exp;
    }

    private void convertRegularExpression() {
        String exp = "(" + this.expression.substring(this.expression.indexOf('(') + 1, this.expression.length() - 1) + ")";
        exp = exp.replaceAll("\\.\\.", ").+(")
                .replaceAll("\\*", ").+(");
        this.exp = exp;
    }
}
